//
//  LoginRegisterAvatarView.swift
//  GLUZSwift
//
//  Created by xyanl on 2025/3/7.
//  Copyright © 2025 考拉🐨. All rights reserved.
//

import UIKit
import Reusable
import Localize_Swift

extension LoginRegisterAvatarView: NibLoadable {}

class LoginRegisterAvatarView: UIView {

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var chineseRequiredLabel: UILabel!
    @IBOutlet weak var ruRequiredLabel: UILabel!
    
    @IBOutlet weak var avatarButton: UIButton!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        chineseRequiredLabel.addRoundedCorners(radius: 8)
        avatarButton.addRoundedCorners(radius: 8)
        
        chineseRequiredLabel.isHidden = true
        ruRequiredLabel.isHidden = true
        
        /// 监听语言的变化
        NotificationCenter.default.addObserver(self, selector: #selector(updateLanguageAction), name: NSNotification.Name(LCLLanguageChangeNotification), object: nil)
        updateLanguageAction()
    }
    
    // 更新语言
    @objc private func updateLanguageAction() {
        
        titleLabel.text = "上传用户头像".localized(.login)
        
//        if LanguageManager.isLanguageZH {
//            chineseRequiredLabel.isHidden = false
//            ruRequiredLabel.isHidden = true
//
//        } else {
//            chineseRequiredLabel.isHidden = true
//            ruRequiredLabel.isHidden = false
//        }
        
    }
}
